home *** CD-ROM | disk | FTP | other *** search
- class FPUI.TreeNode
- {
- static var m_nextID = 0;
- var m_label = "";
- var m_data = null;
- var m_open = false;
- var m_branch = false;
- var m_level = 0;
- var m_kids = null;
- var m_parent = null;
- var m_lastDrawnWidth = 0;
- var m_uniqueID = 0;
- function TreeNode(s, d)
- {
- var _loc1_ = this;
- _loc1_.m_label = s;
- _loc1_.m_data = d;
- _loc1_.m_kids = new Array();
- _loc1_.m_uniqueID = ++FPUI.TreeNode.m_nextID;
- }
- function getDataItemLabel()
- {
- return this.m_label;
- }
- function getDataItemData()
- {
- return this.m_data;
- }
- function getDataItemUniqueID()
- {
- return this.m_uniqueID;
- }
- function getLevel()
- {
- return this.m_level;
- }
- function setLevel(lev)
- {
- this.m_level = lev;
- }
- function getLastDrawnWidth()
- {
- return this.m_lastDrawnWidth;
- }
- function setLastDrawnWidth(i)
- {
- this.m_lastDrawnWidth = i;
- }
- function addNode(kid)
- {
- this.addChildNodeAt(this.m_kids.length,kid);
- }
- function addChildNodeAt(i, kid)
- {
- var _loc1_ = this;
- var _loc2_ = kid;
- _loc1_.m_branch = true;
- _loc1_.m_kids.splice(i,0,_loc2_);
- _loc2_.m_parent = _loc1_;
- _loc2_.m_level = _loc1_.m_level + 1;
- }
- function getChildNodes()
- {
- return this.m_kids;
- }
- function getLength()
- {
- return this.m_kids.length;
- }
- function isBranch()
- {
- return this.m_branch;
- }
- function isOpen()
- {
- return this.m_open;
- }
- function setIsOpen(b)
- {
- this.m_open = b;
- }
- function isOnOpenBranch()
- {
- var _loc2_ = true;
- var _loc1_ = this.m_parent;
- while(_loc2_ && _loc1_ != null)
- {
- _loc2_ &= _loc1_.isOpen();
- _loc1_ = _loc1_.m_parent;
- }
- return _loc2_;
- }
- }
-